public class demo28 {
    public static void main(String[] args) {
        int[] array = {-10, 2, 3, 246, -100, 0, 5};
        double sum = 0;
        int max = array[0];
        int min = array[0];
        for (int num : array) {
            sum += num;
            if (num > max) {
                max = num;
            }
            if (num < min) {
                min = num;
            }
        }
        double average = sum / array.length;

        System.out.println("平均值: " + average);
        System.out.println("最大值: " + max);
        System.out.println("最小值: " + min);
            }
        }

